/**
 * Created by lixiaodi on 2019/04/08 0027.
 */

mini.parse();
var grid = mini.get("datagrid1");
var url = bootPATH + "../frame/frame1/pages/";      //路径前缀
var menu = new ColumnsMenu(grid);
//初始化
$(function(){
	httpRequest();
});
//确定
function onOk() {
    var row = grid.getSelected();
    console.log(row);
    candidateGroup = row;
    return candidateGroup;
}
//刷新
function refresh(){
	httpRequest();
}
//数据请求
function httpRequest(){
	$.ajax({
        url: ajaxUrl + "/role/list.do",
        type:"post",
        success: function (data) {
        	var roleData = data.data;
        	//日期格式化
        	for(var i = 0; i < roleData.length; i++){
        		//创建日期
        		if(roleData[i].createDate){
        			roleData[i].createDate = formatDate(roleData[i].createDate);
        		}else{
        			roleData[i].createDate = '-';
        		}
        	}
        	grid.setData(roleData);
        },
        error:function(data){
            mini.alert(data.message);
        }
    });
}
//弹出
function alertBox() {
	mini.alert('请选择用户');
}